package windbell.domain.risk.impl;

import edu.fudan.langlab.domain.code.impl.CodeImpl;
import edu.fudan.mylang.pf.IObjectFactory;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;
import windbell.domain.risk.RiskLevel;
import windbell.domain.risk.proxy.RiskLevelProxy;

@Entity
@DiscriminatorValue("RISKLEVEL_TYPE")
public class RiskLevelImpl extends CodeImpl implements RiskLevel {
  public RiskLevelImpl() {
    super();
  }
  
  public static RiskLevel create(final IObjectFactory objectFactory) {
    windbell.domain.risk.RiskLevel riskLevel = new windbell.domain.risk.impl.RiskLevelImpl(
    );
    objectFactory.create(riskLevel);
    return riskLevel;			
    
  }
  
  public static RiskLevel createRiskLevelImpl(final IObjectFactory objectFactory, final Procedure1<RiskLevel> init) {
    windbell.domain.risk.RiskLevel riskLevel = new windbell.domain.risk.impl.RiskLevelImpl(
    );
    objectFactory.create(riskLevel);
    init.apply(riskLevel);
    return riskLevel;			
    
  }
  
  public RiskLevelProxy toProxy() {
    windbell.domain.risk.proxy.RiskLevelProxy proxy = new windbell.domain.risk.proxy.RiskLevelProxy();
    proxy.setId(this.getId());
    if(this instanceof edu.fudan.mylang.pf.INamedModelObject){
    	proxy.setName(((edu.fudan.mylang.pf.INamedModelObject)this).getEntityName());
    }
    return proxy;
    
  }
}
